package offer;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class Offer56 {


    public int[] singleNumbers(int[] nums){
        ArrayList<Integer> list = new ArrayList<>();
        HashMap<Integer, Boolean> map = new HashMap<>();
        for (int a : nums) {
map.put(a,!map.containsKey(a));
        }

        for (Map.Entry<Integer,Boolean> d: map.entrySet()) {
            if (d.getValue()) {
                list.add(d.getKey());
            }
        }

        int[] res=new  int[list.size()];
            for (int i = 0; i < list.size(); i++) {
                res[i]= list.get(i);
            }


        return  res;




    }

}
